#pragma once

#include "House.h"

typedef enum HouseSortType
{
    SORT_TYPE_SN,
    SORT_TYPE_NUM,
    SORT_TYPE_STRSTATUS,
    SORT_TYPE_UNITPRICE,
    SORT_TYPE_SIZETOTAL,
    SORT_TYPE_SIZESELF,
    SORT_TYPE_SIZESHARE,
    SORT_TYPE_TOTALPRICE
}HouseSortType;

class HouseSort
{
public:
    HouseSort(HouseSortType type, bool bAsc):m_bSortType(type), m_bAsc(bAsc){};
    ~HouseSort(void){};

public:
    bool operator()(const House& house1, const House& house2);

private:
    HouseSortType m_bSortType;
    bool m_bAsc;

private:
    bool sortBySn(const House& house1, const House& house2);
    bool sortByNum(const House& house1, const House& house2);
    bool sortByStatus(const House& house1, const House& house2);
    bool sortByUnixPrice(const House& house1, const House& house2);
    bool sortBySizeTotal(const House& house1, const House& house2);
    bool sortBySizeSelf(const House& house1, const House& house2);
    bool sortBySizeShare(const House& house1, const House& house2);
    bool sortByTotalPrice(const House& house1, const House& house2);
};
